﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 02 November 2012 16:44:35
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Data;
using NetDon.OA.Data;
using NetDon.OA.Data.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.OA.Data.FactoryClasses
{
	/// <summary>
	/// Generates IEntityFields instances for different kind of Entities. 
	/// This class is generated. Do not modify.
	/// </summary>
	public partial class EntityFieldsFactory
	{
		/// <summary>
		/// Private CTor, no instantiation possible.
		/// </summary>
		private EntityFieldsFactory()
		{
		}


		/// <summary>General factory entrance method which will return an EntityFields object with the format generated by the factory specified</summary>
		/// <param name="relatedEntityType">The type of entity the fields are for</param>
		/// <returns>The IEntityFields instance requested</returns>
		public static IEntityFields CreateEntityFieldsObject(NetDon.OA.Data.EntityType relatedEntityType)
		{
			IEntityFields fieldsToReturn=null;
			IInheritanceInfoProvider inheritanceProvider = InheritanceInfoProviderSingleton.GetInstance();
			IFieldInfoProvider fieldProvider = FieldInfoProviderSingleton.GetInstance();
			IPersistenceInfoProvider persistenceProvider = PersistenceInfoProviderSingleton.GetInstance();
			switch(relatedEntityType)
			{
				case NetDon.OA.Data.EntityType.AreaEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "AreaEntity");
					break;
				case NetDon.OA.Data.EntityType.AttachmentsEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "AttachmentsEntity");
					break;
				case NetDon.OA.Data.EntityType.CityEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CityEntity");
					break;
				case NetDon.OA.Data.EntityType.CompanyEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CompanyEntity");
					break;
				case NetDon.OA.Data.EntityType.ConfigurationEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ConfigurationEntity");
					break;
				case NetDon.OA.Data.EntityType.CustomerGoodsShippingTypeEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CustomerGoodsShippingTypeEntity");
					break;
				case NetDon.OA.Data.EntityType.CustomerInfoEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "CustomerInfoEntity");
					break;
				case NetDon.OA.Data.EntityType.DeliveryOrderCodeConfigEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DeliveryOrderCodeConfigEntity");
					break;
				case NetDon.OA.Data.EntityType.DepartmentEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DepartmentEntity");
					break;
				case NetDon.OA.Data.EntityType.DepartmentManagerEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DepartmentManagerEntity");
					break;
				case NetDon.OA.Data.EntityType.DictionaryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DictionaryEntity");
					break;
				case NetDon.OA.Data.EntityType.DictionaryCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "DictionaryCategoryEntity");
					break;
				case NetDon.OA.Data.EntityType.FunctionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "FunctionEntity");
					break;
				case NetDon.OA.Data.EntityType.GoodsTravelDaysConfigEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "GoodsTravelDaysConfigEntity");
					break;
				case NetDon.OA.Data.EntityType.ImageEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ImageEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderDeliveryEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderOnWayTrackEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackCommentEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderOnWayTrackCommentEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderOnWayTrackHistoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderOnWayTrackHistoryEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderReceiptInfoTrackEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackCommentEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderReceiptInfoTrackCommentEntity");
					break;
				case NetDon.OA.Data.EntityType.IssuingOrderVehicleInfoEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "IssuingOrderVehicleInfoEntity");
					break;
				case NetDon.OA.Data.EntityType.LogEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "LogEntity");
					break;
				case NetDon.OA.Data.EntityType.MachineAccountIncomeEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "MachineAccountIncomeEntity");
					break;
				case NetDon.OA.Data.EntityType.MachineAccountPaymentEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "MachineAccountPaymentEntity");
					break;
				case NetDon.OA.Data.EntityType.PostEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "PostEntity");
					break;
				case NetDon.OA.Data.EntityType.ProductEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ProductEntity");
					break;
				case NetDon.OA.Data.EntityType.ProvinceEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ProvinceEntity");
					break;
				case NetDon.OA.Data.EntityType.ReportEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportEntity");
					break;
				case NetDon.OA.Data.EntityType.ReportCategoryEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ReportCategoryEntity");
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RevenueMachineAccountEntity");
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RevenueMachineAccountInvoiceEntity");
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceOrderEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RevenueMachineAccountInvoiceOrderEntity");
					break;
				case NetDon.OA.Data.EntityType.RevenueMachineAccountInvoiceReceiptEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RevenueMachineAccountInvoiceReceiptEntity");
					break;
				case NetDon.OA.Data.EntityType.RoleEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RoleEntity");
					break;
				case NetDon.OA.Data.EntityType.RoleFunctionEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RoleFunctionEntity");
					break;
				case NetDon.OA.Data.EntityType.RouteEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "RouteEntity");
					break;
				case NetDon.OA.Data.EntityType.ShuntingCostConfigEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "ShuntingCostConfigEntity");
					break;
				case NetDon.OA.Data.EntityType.SysParameterEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "SysParameterEntity");
					break;
				case NetDon.OA.Data.EntityType.UserEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "UserEntity");
					break;
				case NetDon.OA.Data.EntityType.UserRoleEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "UserRoleEntity");
					break;
				case NetDon.OA.Data.EntityType.VehicleModelEntity:
					fieldsToReturn = fieldProvider.GetEntityFields(inheritanceProvider, persistenceProvider, "VehicleModelEntity");
					break;
			}
			return fieldsToReturn;
		}
		
		/// <summary>General method which will return an array of IEntityFieldCore objects, used by the InheritanceInfoProvider. Only the fields defined in the entity are returned, no inherited fields.</summary>
		/// <param name="entityName">the name of the entity to get the fields for. Example: "CustomerEntity"</param>
		/// <returns>array of IEntityFieldCore fields, defined in the entity with the name specified</returns>
		internal static IEntityFieldCore[] CreateFields(string entityName)
		{
			IFieldInfoProvider fieldProvider = FieldInfoProviderSingleton.GetInstance();
			IPersistenceInfoProvider persistenceProvider = PersistenceInfoProviderSingleton.GetInstance();
			return fieldProvider.GetEntityFieldsArray(entityName, persistenceProvider);
		}



		#region Included Code

		#endregion
	}
}
